< previous page page_941 next page >

Page 941
#Else
   Declare Function WinHelp Lib "user32" Alias "WinHelpA" (ByVal hwnd As Long,
   _ By Val lpHelpFile As String, ByVal wCommand As Long,
   _ ByVal dwData As Any) As Long
   Declare Function ShellAbout Lib "shell32.dll" Alias "ShellAboutA"
   _ (ByVal hwnd As Long,
   _ ByVal szApp As String, ByVal szOtherStuff As String,
   _ ByVal hIcon As Long) As Long

#End If
Global Const HELP_QUIT = 2
Global Const HELP_INDEX = 3
Global Const HELP_HELPONHELP = 4
Global Const HELP_PARTIALKEY = &H105
Insert a new procedure by selecting Procedure from the Insert menu, name it HelpFile, and insert the following code:
Sub HelpFile (frmForm As Form, nHelpCmd As Integer)
   Dim i As Integer
   Dim nFlag As Integer
   Dim aData As Variant
   '
'Test for the naming of a help file
   If Len(LTrim(RTrim(App.HelpFile))) = 0 Then
      MsgBox "No Help File Available"
      GoTo HelpFile_Exit
   End If
'Set a text flag
   Select Case nHelpCmd
      Case Is = HELP_QUIT
         nFlag = True
      Case Is = HELP_INDEX
         nFlag = True
      Case Is = HELP_HELPONHELP
         nFlag = True
      Case Is = HELP_PARTIALKEY
         nFlag = True
      Case Else
         nFlag = False 'invalid command!
   End Select
'Pass parameters to the DLL call
   If nFlag = True Then
      If nHelpCmd = HELP_PARTIALKEY Then
         i = WinHelp(frmForm.hWnd, App.HelpFile, nHelpCmd, "")
      Else
         i = WinHelp(frmForm.hWnd, App.HelpFile, nHelpCmd, 0&)
      End If
   Else
      MsgBox "Invalid Help Command Value"
   End If
   '
HelpFile_Exit:
End Sub

 
< previous page page_941 next page >

If you like this book, buy it!